import 'dart:developer';

import 'package:beautiful_demo/controller.dart';
import 'package:beautiful_demo/mvc/controller.dart';
import 'package:drive/drive.dart';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_mvc/flutter_mvc.dart' as mvc;
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'common/manager/manager.dart';
import 'config.dart';
import 'mvc/chat/room/controller.dart';
import 'mvc/user/login/controller.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

ScreenUtil screenUtils;

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    //需要用MvcMaterialApp代替MaterialApp
    return ScreenUtilInit(
        designSize: const Size(375, 812),
        builder: (ctx,c) {
          CachedImage.defult_loading_image =
              "images/xuankuanjia_shangkuan_xq.png";
          screenUtils = ScreenUtil();
          return mvc.MvcMaterialApp(
            isStandbyLifecycle: true,
            home: Builder(builder: (context) {
              ToastUtils.context=context;
              Config.mediaQuery=MediaQuery.of(context);
              // return LoginController().widget;
              return StartController().widget;
            }),
          );
        });
  }
}
